﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Convertor.Plugin.FindAllFiles
{
    class IsCheckedConvertor : IMultiValueConverter
    {
        #region IMultiValueConverter 成员

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ConfigContent config = values[0] as ConfigContent;
            if (config != null)
            {
                FindTypes type = (FindTypes)values[1];
                return config.FindType.HasFlag(type);
            }
            else
            {
                return false;
            }
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }

        #endregion
    }
}
